Skip to content

Conversation

@pilimartinez
Copy link
Member

@pilimartinez pilimartinez commented Jan 20, 2026

Affected Components

  • CLI
  • Create CLI
  • Test
  • Docs
  • Examples
  • Other

Notes for the Reviewer

Detect if theres a headless: false in the playwright.config and show an error.

image

}
}
} catch {
// Config loading errors are handled by existing playwrightConfigPath validation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you verify this? I don't think this is 100% true, if we fail to load we should throw an error that we are unable to parse the config

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ferrandiaz Thanks for the review, you are right. Should be fixed now.

ferrandiaz
ferrandiaz previously approved these changes Jan 21, 2026
Copy link
Member

@sorccu sorccu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to check if we can avoid loading the config file multiple times. Maybe not but it seems wasteful.

Just blocking the merge for a moment.

@pilimartinez pilimartinez marked this pull request as ready for review January 21, 2026 14:52
const playwrightConfig = await Session.loadFile<any>(this.playwrightConfigPath)

if (playwrightConfig?.use?.headless === false) {
diagnostics.add(new UnsupportedPropertyDiagnostic(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If only false is not supported, use InvalidPropertyValueDiagnostic. If any value is unsupported, then use UnsupportedPropertyDiagnostic. It will slightly change the error message, so adjust tests accordingly if needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sorccu You are correct, the property is supported with value: true. Changing it to InvalidPropertyValueDiagnostic.

@sorccu sorccu merged commit 609c4cd into main Jan 28, 2026
8 of 12 checks passed
@sorccu sorccu deleted the pilar/tra-1789-add-cli-guardrails-to-common-errors-webserver-headed branch January 28, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants